<template>
  <div class="create">
    <NavBar>
      <div v-for="(item,index) in navBarItem" :key="index" :class="{active:index==isActive}" @click="changeRouter(index)">
        <NavBarItem>{{ item }}</NavBarItem>
      </div>
    </NavBar>
    <!--    基本信息板块-->
    <div v-if="clickItem == '基本信息'" class="message">
      <Message></Message>
    </div>
    <!--    临床诊断板块-->
    <div v-else-if="clickItem=='临床诊断'" class="clinicalDiagnosis">
      <ClinicalDiagnosis></ClinicalDiagnosis>
    </div>
    <!--    影像资料板块-->
    <div v-else-if="clickItem=='影像资料'">
      <Viewdata></Viewdata>
    </div>
    <!--    口扫或牙模板块-->
    <div v-else-if="clickItem == '口扫或牙模'">
      <SendingDentalMolds></SendingDentalMolds>
    </div>
    <!--    预览病历模块-->
    <div v-else>
      <PreviewMedicalRecord></PreviewMedicalRecord>
    </div>

    <!--    底部导航栏-->
    <div class="bot-bar">
      <BottomBar>
        <button class="btn">下一步</button>
      </BottomBar>
    </div>
    <!--    弹框-->
    <div class="prompt">
      <!--      基本信息里的 相同患者弹框-->
      <div class="samePatient">
        <Prompt :commons="samePatient">
          <SamePatient></SamePatient>
        </Prompt>
      </div>
      <!--      基本信息里的 上传头像弹框-->
      <div class="upload">
        <div>
          <Prompt :commons="upload">
            <Fileimg></Fileimg>
          </Prompt>
        </div>
        <div>
          <Prompt :commons="upload">
            <Fileimg></Fileimg>
          </Prompt>
        </div>
      </div>
      <!--      口扫或牙模里的 免费邮寄弹框-->
      <div>

      </div>
      <!--      影像资料里的 裁剪弹框-->
      <div>
        <Prompt :commons="splice">
          <SamePatient></SamePatient>
        </Prompt>
      </div>
    </div>
  </div>
</template>
<script>
import NavBar from './children/NavBar';
import NavBarItem from './children/NavBarItem';
import BottomBar from './children/BottomBar';
import Message from './Message';
import Prompt from './children/Prompt';
import SamePatient from './children/SamePatient';
import Fileimg from './children/Fileimg';
import ClinicalDiagnosis from './ClinicalDiagnosis';
import Viewdata from './Viewdata';
import SendingDentalMolds from './SendingDentalMolds';
import PreviewMedicalRecord from './PreviewMedicalRecord';

export default {
  name: 'Create',
  components: {
    NavBar,
    NavBarItem,
    BottomBar,
    Message,
    Prompt,
    SamePatient,
    Fileimg,
    ClinicalDiagnosis,
    Viewdata,
    SendingDentalMolds,
    PreviewMedicalRecord
  },
  data() {
    return {
      navBarItem: ['基本信息', '临床诊断', '影像资料', '口扫或牙模', '预览病历'],
      clickItem: '基本信息',
      isActive: 0,
      samePatient: {
        same: '相同患者',
        btn: ['继续新增', '同一患者'],
        aligin: 'flex-end',
        promptWidth: '520px',
        promptHeight: '331px'
      },
      upload: {
        same: '上传头像',
        btn: ['取消', '确定'],
        aligin: 'center',
        promptWidth: '492px',
        promptHeight: '499px'
      },
      splice: {
        same: '裁剪',
        btn: ['取消', '确定'],
        aligin: 'center',
        promptWidth: '640px',
        promptHeight: '497px'
      }
    };
  },
  methods: {
    changeRouter(index) {
      this.isActive = index;
      this.clickItem = this.navBarItem[index];
    }
  }
};
</script>

<style lang="scss" scoped>
.create{
  color: #666666;
  position: relative;
}
.message{
  padding: 0px 20px 40px;
  position: relative;
  /*padding-bottom: 72px;*/
}
.btn{
  width: 88px;
  height: 28px;
  background: #508FCC;
  border-radius: 24px;
  color: #ffffff;
  font-size: 16px;
}
.el-form-item__label{
  color: red;
  font-weight: normal;
}
.el-form-item__content{
  color: #508FCC;
}
.bot-bar{
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
}
.active{
  font-size: 20px;
  font-weight: bold;
  color: #508FCC;
}
.samePatient{
  width: 520px;
  height: 331px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -260px;
  margin-top: -165px;
  display: none;
}
.prompt{
  background: rgba(0,0,0,0.3);
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0px;
  top: 0px;
  z-index: 1002;
  display: none;
}
.upload{
  /*display: flex;*/
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -564px;
  margin-top: -250px;
  display: none;
}
.upload>div{
  margin: 0px 36px;
}
</style>
